package com.openspring.baseinfo.model;

import com.openspring.framework.annotation.persistence.Column;
import com.openspring.framework.annotation.persistence.GeneratedValue;
import com.openspring.framework.annotation.persistence.Id;
import com.openspring.framework.annotation.persistence.Join;
import com.openspring.framework.annotation.persistence.Table;

@Table(name="t_baseinfo_district", schema="emp", alias="t0")
@Join("LEFT JOIN emp.t_platform_dictionary t1 ON t1.value = t0.level AND t1.\"dictId\" IN (SELECT id FROM emp.t_platform_dict WHERE code = 'district_level')")
public class District {

	private Long id;
	private Long parentId;
	private String code;
	private String name;
	private String level;
	private String status;
	private long sort;
	
	private String levelName;
	
	@Id
	@GeneratedValue
	@Column(name="id", table="t0")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="parentId", table="t0")
	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
	@Column(name="code", table="t0")
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@Column(name="name", table="t0")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name="level", table="t0")
	public String getLevel() {
		return level;
	}
	public void setLevel(String level) {
		this.level = level;
	}
	@Column(name="status", table="t0")
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	@Column(name="sort", table="t0")
	public long getSort() {
		return sort;
	}
	public void setSort(long sort) {
		this.sort = sort;
	}
	@Column(name="display", insertable=false, updatable=false, table="t1")
	public String getLevelName() {
		return levelName;
	}
	public void setLevelName(String levelName) {
		this.levelName = levelName;
	}
}
